﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIAKADCORE.Models
{
    /// <summary>
    /// Kelas Kelas [dbo].[kelas]
    /// </summary>
    public class Kelas
    {
        #region Constants
        /// <summary>
        /// Konstanta panjang id dari primary key
        /// </summary>
        public const int IdLength = 5;
        /// <summary>
        /// Konstanta prefix dari primary key
        /// </summary>
        public const string IdPrefix = "KLS";
        /// <summary>
        /// Konstanta nama tabel pada database
        /// </summary>
        public const string TableName = "[dbo].[kelas]";
        /// <summary>
        /// Konstanta nama kolom idKelas pada tabel
        /// </summary>
        public const string ColumnNameIdKelas = "[id_kelas]";
        /// <summary>
        /// Konstanta nama kolom namaKelas pada tabel
        /// </summary>
        public const string ColumnNameNamaKelas = "[kelas]";
        #endregion

        #region Fields
        /// <summary>
        /// [id_kelas] CHAR(5) PRIMARY KEY
        /// </summary>
        private string idKelas;
        /// <summary>
        /// [kelas] CHAR(1) NOT NULL
        /// </summary>
        private string namaKelas;
        #endregion

        #region Properties
        /// <summary>
        /// [id_kelas] CHAR(5) PRIMARY KEY
        /// </summary>
        public string IdKelas
        {
            get { return this.idKelas; }
            set { this.idKelas = value; }
        }

        /// <summary>
        /// [kelas] CHAR(1) NOT NULL
        /// </summary>
        public string NamaKelas
        {
            get { return this.namaKelas; }
            set { this.namaKelas = value; }
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Konstruktor
        /// </summary>
        public Kelas()
        {

        }

        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="idKelas">[id_kelas] CHAR(5) PRIMARY KEY</param>
        /// <param name="namaKelas">[kelas] CHAR(1) NOT NULL</param>
        public Kelas(string idKelas, string namaKelas)
        {
            this.idKelas = idKelas;
            this.namaKelas = namaKelas;
        }
        #endregion

        public override string ToString()
        {
            return string.Format("ID_KELAS: {0} | KELAS; {1}", this.idKelas, this.namaKelas);
        }
    }
}
